package experiment;

import army.Army;


public class Experiment {
	Army army1;
	Army army2;
	
	public Experiment(Army army1, Army army2){
		this.army1 = army1;
		this.army2 = army2;
	}
	
	public double makeExperiment(int nTimes) {
		int result;
		int sum = 0;
		
		for (int i = 0; i < nTimes; i++) {
			Army army1copy = new Army(army1);
			Army army2copy = new Army(army2);
	
			Battle battle = new Battle(army1copy, army2copy);
			result = battle.fight();
			sum += result;
		}
		
		return sum / (double) nTimes;
	}

}
